﻿using BluetoothMachine.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BluetoothMachine.Lucifer
{
    public interface ICommunication
    {
        int Index { get; set; }
        DeviceType Types { get; set; }
        public List<byte> ByteBuffer { get; set; }
        /// <summary>
        /// False：串口 True：网口
        /// </summary>
        bool CommType { get; set; }

        void Connection();
        void Disconnect();

        void Read(object obj = null);
        byte[] Read();

        void Write(byte[] bytes);
        void Write(IProtocol protocol);

        T ReadClass<T>(IProtocol protocol) where T : new();

        T ReadClass<T>(object obj);
    }
}
